<template>
	<view class="container">
		<!-- <navbar :title="title"></navbar> -->
		<uv-parse :content="content"></uv-parse>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				content:"",
				pageType:0,
				title:''
			};
		},
		onLoad(option) {
			this.pageType = option.type ? option.type : 0;
			this.getContent()
		},
		methods:{
			getContent(){
				let api;
				if(this.pageType == 0){
					api = app.getApi().user.aboutUs;
					uni.setNavigationBarTitle({
						title:'平台介绍'
					})
				}else{
					api = app.getApi().user.protocolDetail;
				}
				app.globalRequest({
					api,
					data:{
						type:this.pageType
					}
				}).then(res=>{
					if(res.code == 0){
						if(this.pageType == 0){
							this.content = res.data;
						}else{
							this.content = res.data.protocolList.content;
							uni.setNavigationBarTitle({
								title:res.data.protocolList.title
							})
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		padding:30rpx;
	}
</style>
